<?php
if (!file_exists('responses')) {
    function responses($msg, $data, $code)
    {
        return [
            'code' => $code,
            'data' => $data,
            'msg' => $msg
        ];
    }
}

//响应成功
if (!file_exists('success')) {
    function success($msg, $data, $code = 20000)
    {
        return [
            'code' => $code,
            'msg' => $msg,
            'data' => $data,

        ];
    }
}

//响应失败
if (!file_exists('fails')) {
    function fails($msg, $data, $code = 400)
    {
        return [
            'code' => $code,
            'msg' => $msg,
            'data' => $data,

        ];
    }
}
